home *** CD-ROM | disk | FTP | other *** search
- // Copyright 1994 by Jon Dart. All Rights Reserved.
-
- #ifndef _PINFO_H
- #define _PINFO_H
-
- #include "move.h"
- #include <stddef.h>
-
- class Position_Info
- {
- // this class represents one entry in the hash table.
-
- public:
-
- friend unsigned long hash_code(Position_Info &p);
-
- enum ValueType { Invalid, Valid, UpperBound, LowerBound };
-
- Position_Info( const Board &board, const int depth,
- const ValueType hashflags,
- const Boolean forced,
- const int rep_count,
- const int value,
- const Move &best_move);
-
- // construct an object that can be used for searching:
- Position_Info( const Board &board, int rep_count );
-
- int operator == ( const Position_Info &p)
- {
- return (my_hashcode == p.my_hashcode) &&
- (my_xhashcode == p.my_xhashcode);
- }
-
- ValueType type() const
- {
- return (ValueType)(my_flags & 0x7);
- }
-
- Boolean forced() const
- {
- return (my_flags & 0x80) != 0;
- }
-
- unsigned long hash_code() const
- {
- return my_hashcode;
- }
-
- int depth() const
- {
- return my_depth;
- }
-
- int value() const
- {
- return my_value;
- }
-
- const Move &best_move() const
- {
- return my_best_move;
- }
-
- private:
-
- signed char my_depth;
- byte my_flags;
- unsigned long my_hashcode;
- int16 my_xhashcode;
- int16 my_value;
- Move my_best_move;
- };
-
- unsigned long hash_code(const Position_Info &p);
-
- #endif
-